# 1. 导入FastDFS客户端扩展
from fdfs_client.client import Fdfs_client

# 2. 创建FastDFS客户端实例
# 3. 调用FastDFS客户端上传文件方法
if __name__ == '__main__':
    client = Fdfs_client('client.conf')

    # 上传
    # data = client.upload_by_file('/home/python/Desktop/1.jpg')
    # print(data)
    '''
    {
        'Remote file_id': 'group1/M00/00/02/wKgvgV2mcQyAf2jIAAAhg8MeEWU331.jpg',
        'Storage IP': '192.168.47.129',
        'Local file name': '/home/python/Desktop/1.jpg',
        'Group name': 'group1',
        'Status': 'Upload successed.',
        'Uploaded size': '8.00KB'
    }
    '''
    # 修改====>内部实现有错误
    # data = client.modify_by_file('/home/python/Desktop/2.jpg', 'group1/M00/00/02/wKgvgV2mcQyAf2jIAAAhg8MeEWU331.jpg')
    # print(data)

    # 删除
    # data = client.delete_file('group1/M00/00/02/wKgvgV2mcQyAf2jIAAAhg8MeEWU331.jpg')
    # print(data)
